<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title th:replace="${title}">标题</title>

  <link href="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.css" rel="stylesheet">
  <link rel="stylesheet" th:href="@{/css/typo.css}">
  <link rel="stylesheet" th:href="@{/lib/editormd/css/editormd.preview.css}">
  <link rel="stylesheet" th:href="@{/css/animate.css}">
  <link rel="stylesheet" th:href="@{/lib/prism/prism.css}">
  <link rel="stylesheet" th:href="@{/lib/tocbot/tocbot.css}">
  <link rel="stylesheet" th:href="@{/css/main.css}">
</head>
<body>

<!--顶部导航-->
<header th:fragment="header(active)" class="ui inverted attached segment m-shadow-small">
  <div class="ui container">
    <nav class="ui inverted secondary stackable menu">
      <h2 class="ui header teal item m-header-logo">Blog</h2>
      <a href="#" class="m-header-item m-hide-on-mobile item" th:classappend="${active==1}?'active'"
         th:href="@{/}">
        <i class="small home icon"></i> 首页
      </a>
      <a href="#" class="m-header-item m-hide-on-mobile item" th:classappend="${active==2}?'active'"
         th:href="@{/categories}">
        <i class="small idea icon"></i> 分类
      </a>
      <a href="#" class="m-header-item m-hide-on-mobile item" th:classappend="${active==3}?'active'"
         th:href="@{/tags}">
        <i class="small tags icon" style="margin-right: 8px;"></i> 标签
      </a>
      <a href="#" class="m-header-item m-hide-on-mobile item" th:classappend="${active==4}?'active'"
         th:href="@{/archives}">
        <i class="small clone icon"></i> 归档
      </a>
      <a href="#" class="m-header-item m-hide-on-mobile item" th:classappend="${active==5}?'active'"
         th:href="@{/about}">
        <i class="small info icon"></i> 关于我
      </a>
      <div class="right item m-header-item m-hide-on-mobile">
        <form id="search" action="" th:action="@{/search}">
          <div class="ui icon inverted transparent input">
            <input type="text" name="s" placeholder="Search...">
            <i class="search link icon" onclick="document.forms['search'].submit()"></i>
          </div>
        </form>
      </div>
    </nav>
  </div>

  <a href="#" class="ui black icon button m-header-toggle-icon m-show-on-mobile toggle">
    <i class="sidebar icon"></i>
  </a>
</header>


<!--footer-->
<footer th:fragment="footer" class="ui vertical inverted segment m-footer">
  <div class="ui container center aligned">
    <div class="ui stackable grid divided inverted">
      <!--二维码-->
      <div class="three wide column">
        <div class="ui inverted link list">
          <div class="item">
            <img src="https://via.placeholder.com/110?text=WeChat" class="ui rounded image" alt="">
          </div>
        </div>
      </div>
      <!--二维码-->

      <!--最新博客-->
      <div class="three wide column">
        <h4 class="ui inverted header m-text-thin m-text-spacing">最新博客</h4>
        <div id="newestArticles" class="ui inverted link list">
          <th:block th:fragment="newestArticles">
            <a href="#" class="item" th:each="article : ${newestArticles}" th:text="${article.title}"
               th:href="@{/blog/{id}(id=${article.id})}">
              用户故事 (User Story)
            </a>
            <!--/*-->
            <a href="#" class="item">用户故事 (User Story)</a>
            <a href="#" class="item">用户故事 (User Story)</a>
            <!--*/-->
          </th:block>
        </div>
      </div>
      <!--最新博客-->

      <!--联系我-->
      <div class="three wide column">
        <h4 class="ui inverted header m-text-thin m-text-spacing">联系我</h4>
        <div class="ui inverted link list">
          <a href="#" class="item">Email: <span th:text="#{user.email}"></span></a>
          <a href="#" class="item">QQ: <span th:text="#{user.qq}"></span></a>
        </div>
      </div>
      <!--联系我-->

      <!--关于-->
      <div class="seven wide column">
        <h4 class="ui inverted header m-text-thin m-text-spacing">关于</h4>
        <p class="m-text-thin m-text-spacing m-opacity-80">這是我的個人博客</p>
      </div>
      <!--关于-->

    </div>
    <div class="ui inverted section divider"></div>
    <p class="m-text-thin m-text-spacing m-opacity-60">by Misty</p>
  </div>
</footer>

<th:block th:fragment="scripts">
  <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://cdn.bootcss.com/semantic-ui/2.4.1/semantic.min.js"></script>
  <script th:src="@{/lib/prism/prism.js}"></script>
  <script th:src="@{/lib/tocbot/tocbot.min.js}"></script>
  <script th:src="@{/lib/qrcode/qrcode.min.js}"></script>
  <script th:inline="javascript">
      $("#newestArticles").load( /*[[@{/newestArticles}]]*/ "");
  </script>
</th:block>

<th:block th:fragment="scripts-md">
  <script th:src="@{/lib/editormd/lib/marked.min.js}"></script>
  <!--    <script th:src="@{/lib/editormd/lib/prettify.min.js}"></script>-->
  <script th:src="@{/lib/editormd/editormd.js}"></script>
</th:block>

</body>
</html>
